package heima3_2.cn.osc.presenter;

import android.util.Log;

import java.util.List;

import heima3_2.cn.osc.model.bean.EventBean;
import heima3_2.cn.osc.model.bean.MoveMyBean;
import heima3_2.cn.osc.ui.activity_fragment.HotActivityFragment;
import retrofit2.Call;
import retrofit2.Response;

/**
 * Created by emily on 2017/1/16.
 */

public class ExerciseHotPresenter extends BasePresenter<MoveMyBean>{
    HotActivityFragment hotlyActivityFragment;

    public ExerciseHotPresenter(HotActivityFragment hotlyActivityFragment) {
        this.hotlyActivityFragment = hotlyActivityFragment;
    }


    @Override
    protected void getFailureData(Throwable t) {

    }

    @Override
    protected void getSuccessData(Response<MoveMyBean> response) {
        MoveMyBean body = response.body();
        List<EventBean> events = body.getEvents();
       hotlyActivityFragment.exerciseHotAdapater.setDatas(events);
        Log.d("5555555555",body+"");
    }

    @Override
    public void getData(int pager) {
        Call<MoveMyBean> info = mRetrofitInterface.getMoveEventInfo();
        info.enqueue(mCallback);
    }
}
